<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<title>视频信息维护管理</title>
<meta name="decorator" content="default" />
<script type="text/javascript">
	$(document).ready(function() {
		$("#btnImport").click(function() {
			$.jBox($("#importBox").html(), {
				title : "导入数据",
				buttons : {
					"关闭" : true
				},
				bottomText : "导入文件不能超过5M，仅允许导入“xls”或“xlsx”格式文件！"
			});
		});

	});
	function displayImg(img) {
		$.jBox("<img src="+img+">", {
			title : "导入数据",
			buttons : {
				"关闭" : true
			}
		});
	}
	function page(n, s) {
		$("#pageNo").val(n);
		$("#pageSize").val(s);
		$("#searchForm").submit();
		return false;
	}
</script>
</head>
<body>
	<div id="importBox" class="hide">
		<form id="importForm" action="${ctx}/yug/yugVideo/import"
			method="post" enctype="multipart/form-data" class="form-search"
			style="padding-left: 20px; text-align: center;"
			onsubmit="loading('正在导入，请稍等...');">
			<br /> <input id="uploadFile" name="file" type="file"
				style="width: 330px" /><br />
			<br /> <input id="btnImportSubmit" class="btn btn-primary"
				type="submit" value="   导    入   " /> <a
				href="${ctx}/yug/yugVideo/import/template">下载模板</a>
		</form>
	</div>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/yug/yugVideo/">视频信息维护列表</a></li>
		<shiro:hasPermission name="yug:yugVideo:edit">
			<li><a href="${ctx}/yug/yugVideo/form">视频信息维护添加</a></li>
		</shiro:hasPermission>
	</ul>
	<form:form id="searchForm" modelAttribute="yugVideo"
		action="${ctx}/yug/yugVideo/" method="post"
		class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}" />
		<input id="pageSize" name="pageSize" type="hidden"
			value="${page.pageSize}" />
		<ul class="ul-form">
			<li><label>名称：</label> <form:input path="name"
					htmlEscape="false" maxlength="200" class="input-medium" /></li>
			<li class="btns"><input id="btnSubmit" class="btn btn-primary"
				type="submit" value="查询" /> <input id="btnImport"
				class="btn btn-primary" type="button" value="导入" /></li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}" />
	<table id="contentTable"
		class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>名称</th>
				<th>简介</th>
				<th>视频地址</th>
				<th>图片</th>
				<th>类型</th>
				<shiro:hasPermission name="yug:yugVideo:edit">
					<th>操作</th>
				</shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
			<c:forEach items="${page.list}" var="yugVideo">
				<tr>
					<td><a href="${ctx}/yug/yugVideo/form?id=${yugVideo.id}">
							${yugVideo.name} </a></td>
					<td>${fns:abbr(yugVideo.description,40)}</td>
					<td><c:if test="${empty yugVideo.url}">
							<a href="${ctx}/yug/yugVideo/form?id=${yugVideo.id}"> 点击设置url </a>
						</c:if> <c:if test="${yugVideo.url != '' }">
							<a href="${yugVideo.url}" target="_blank"> ${yugVideo.url} </a>
						</c:if></td>
					<td><c:if test="${empty yugVideo.pic}">
					<a href="${ctx}/yug/yugVideo/form?id=${yugVideo.id}"> 点击设置图片地址 </a>
						
					</c:if> <c:if test="${yugVideo.pic != '' }">
							<a href="${yugVideo.pic}" target="_blank"> 点击查看图片 </a>
							<a href="javascript:void(0);"
								onclick="displayImg('${yugVideo.pic}');"> 点击查看图片 </a>
						</c:if></td>
					<td>${yugVideo.category.name}</td>
					<shiro:hasPermission name="yug:yugVideo:edit">
						<td><a href="${ctx}/yug/yugVideo/form?id=${yugVideo.id}">修改</a>
							<a href="${ctx}/yug/yugVideo/delete?id=${yugVideo.id}"
							onclick="return confirmx('确认要删除该视频信息维护吗？', this.href)">删除</a></td>
					</shiro:hasPermission>
				</tr>
			</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>